from __future__ import unicode_literals

from django.db import models

# Create your models here.

class User(models.Model):
    username = models.CharField(max_length=30)
    age = models.IntegerField()
    password = models.CharField(max_length=255)
    def __unicode__(self):
        return self.username

class Warehouse(models.Model):
    accountId = models.CharField(max_length=30)
    name = models.CharField(max_length=30)
    totalBlock = models.IntegerField()
    isLockBlock = models.BooleanField(default=False)
    blockLockUser = models.IntegerField(null=True,blank=True)
    def __unicode__(self):
        return self.name

class Item(models.Model):
    warehouse = models.ForeignKey(Warehouse, on_delete=models.CASCADE)
    name = models.CharField(max_length=30)
    count = models.IntegerField()
    isLock = models.BooleanField(default=False)
    lockUser = models.IntegerField(null=True,blank=True)
    def __unicode__(self):
        return self.name